package com.queclink.ycm.entity.data.useless;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.queclink.ycm.common.utils.HexUtils;
import com.queclink.ycm.entity.data.Data;

/**
 * @author jim.li
 * @email jim.li@queclink.com
 * @date 2021-12-21 16:20:00
 */
public class Data1 extends Data {

    private String ProfileID;


    @JSONField(
            name = "ProfileID"
    )
    public String getProfileID(JSONObject jsonObject) {
        Integer profileID = jsonObject.getInteger("ProfileID");
        return HexUtils.intToHex(profileID, 1);
    }

    public String getDataID() {
        return "01";
    }

    public String getLength() {
        return "01";
    }

    @Override
    public String combine(JSONObject jsonObject) throws Exception {
        StringBuffer sb = new StringBuffer();
        sb.append(this.getDataID());
        sb.append(this.getLength());
        sb.append(this.getProfileID(jsonObject));
        return sb.toString();
    }
}
